package com.jl.js.core;

import org.mozilla.javascript.ScriptableObject;
import org.mozilla.javascript.annotations.JSStaticFunction;

import com.jl.util.Calculator;

public class JSCalculator extends ScriptableObject {

	public JSCalculator() {
	}

	@JSStaticFunction
	public static byte[] lsh(ByteArray ba, int round) {
		return Calculator.lsh(ba.getBytes(), round);
	}

	@JSStaticFunction
	public static byte[] rsh(ByteArray ba, int round) {
		return Calculator.rsh(ba.getBytes(), round);
	}

	@JSStaticFunction
	public static byte[] not(ByteArray ba) {
		return Calculator.not(ba.getBytes());
	}

	@JSStaticFunction
	public static byte[] rol(ByteArray ba, int round) {
		return Calculator.rol(ba.getBytes(), round);
	}

	@JSStaticFunction
	public static byte[] ror(ByteArray ba, int round) {
		return Calculator.ror(ba.getBytes(), round);
	}

	@JSStaticFunction
	public static byte[] xor(ByteArray ba, ByteArray ba1) {
		return Calculator.xor(ba.getBytes(), ba1.getBytes());
	}

	@JSStaticFunction
	public static byte[] or(ByteArray ba, ByteArray ba1) {
		return Calculator.or(ba.getBytes(), ba1.getBytes());
	}

	@JSStaticFunction
	public static byte[] and(ByteArray ba, ByteArray ba1) {
		return Calculator.and(ba.getBytes(), ba1.getBytes());
	}

	@JSStaticFunction
	public static byte[] add(ByteArray ba, ByteArray ba1) {
		return Calculator.add(ba.getBytes(), ba1.getBytes());
	}

	@JSStaticFunction
	public static byte[] sub(ByteArray ba, ByteArray ba1) {
		return Calculator.sub(ba.getBytes(), ba1.getBytes());
	}

	@JSStaticFunction
	public static byte[] mul(ByteArray ba, ByteArray ba1) {
		return Calculator.mul(ba.getBytes(), ba1.getBytes());
	}

	@JSStaticFunction
	public static byte[] div(ByteArray ba, ByteArray ba1) {
		return Calculator.div(ba.getBytes(), ba1.getBytes());
	}

	@JSStaticFunction
	public static byte[] mod(ByteArray ba, ByteArray ba1) {
		return Calculator.mod(ba.getBytes(), ba1.getBytes());
	}

	@Override
	public String getClassName() {
		return "Calculator";
	}

}
